Method of routing a packet in a routing device

ABSTRACT

A method of routing a packet in a routing device having a main processor that includes a main cache table and an instant cache table is disclosed. The instant cache stores a recent address and a recent interface associated with the most recent packet transmission process made by the routing device. The method includes the steps of receiving a packet that includes its destination address, checking whether the destination address belongs to the routing device, checking whether the destination address is identical to the recent address if the destination address does not belong to the routing device, and transmitting the packet to the recent interface if the destination address is identical to the recent address. As a result, the core information related to the routing path determination is stored not only in the routing table of the protocol layer but also in the main and instant cache tables included in the main processor. Since the selection of the routing path for a given packet depends on the individual characteristic of the packet, the data processing time of the packet is greatly reduced. Consequently, the routing performance of the routing device is greatly enhanced.

[0001] This application claims the benefit of the Korean Application No.P2000-84709 filed on Dec. 28, 2001, which is hereby incorporated byreference.

BACKGROUND OF THE INVENTION

[0002] 1. Field of the Invention

[0003] The present invention relates to method of routing a packet in arouting device, and more particularly, to a routing method being able toreduce the packet-processing time by setting a routing path that dependson the characteristic of each packet.

[0004] 2. Discussion of the Related Art

[0005] In general, a device that connects two or more network systemshaving a same transmission protocol is often referred to as a routingdevice. A typical routing device included in a network system sets anode in the system itself or in another network system, and it transmitsone or more packets received using a given transmission path.

[0006]FIG. 1 illustrates a network system including a typical routingdevice 10. The main processor 1 checks whether a packet is receivedthrough a port 6. When the routing device 10 receives a packet, whosedestination address is set to another node or another routing device(e.g., R2), the main processor 1 sends the packet to the protocol layer2 included in the routing device 10. The protocol layer 2 may be any oneof the IP (Internet Protocol) layer 2A, IPX (Internetwork Packetexchange) layer 2B, Bridge layer 2C, and many others.

[0007] For example, when the IP layer 2A receives the packet from themain processor 1, it initially determines whether to process the packet.Once it decides to process the packet, the IP layer 2A sends the packetsto the top application module 3.

[0008] On the other hand, if it decides not to process the packet, itchecks the destination address of the packet. For example, the IP layer2A obtains the interface number corresponding to the destination addressof the packet by searching the IP routing table 4A of the routing table4. And it sends the packets to the interface found. Then the packet getstransmitted to a node or routing device corresponding to the destinationaddress of the packet.

[0009] As described above, the packet passes through a routing path thatincludes the main processor 1 and the IP layer 2A, and this is shown inFIG. 2. Since such routing path is formed regardless of the individualcharacteristic of the packet, the packet-processing rate of the routingdevice 10 is low. Therefore, the performance of the routing device maybe degraded.

[0010] Even though it is highly desirable to provide a method of settinga routing path that depends on the individual characteristic of eachpacket, such method is currently unavailable for the existing routingdevice.

SUMMARY OF THE INVENTION

[0011] Accordingly, the present invention is directed to a method ofrouting a packet in a routing device that substantially obviates one ormore problems due to limitations and disadvantages of the related art.

[0012] An object of the present invention is to provide a method ofrouting a packet in a routing device, in which a routing path depends onthe characteristic of each data packet.

[0013] Another object of the present invention is to provide a method ofrouting a packet that optimizes the routing performance of the routingdevice by minimizing the data processing time of each packet.

[0014] Additional advantages, objects, and features of the inventionwill be set forth in part in the description which follows and in partwill become apparent to those having ordinary skill in the art uponexamination of the following or may be learned from practice of theinvention. The objectives and other advantages of the invention may berealized and attained by the structure particularly pointed out in thewritten description and claims hereof as well as the appended drawings.

[0015] To achieve these objects and other advantages and in accordancewith the purpose of the invention, as embodied and broadly describedherein, a method of routing a packet in a routing device having a mainprocessor that includes a main cache table and an instant cache tableincludes (a) receiving a packet that includes its destination address,(b) checking whether the destination address belongs to the routingdevice, (c) checking whether the destination address is identical to therecent address if the destination address does not belong to the routingdevice, and (d) transmitting the packet to the recent interface if thedestination address is identical to the recent address.

[0016] The method further includes the steps of (e) calculating aHashing Key value (N) of the destination address if it is determinedfrom the step (c) that the destination address is not identical to therecent address, (f) checking whether the destination address isidentical to an Nth cache address stored in the main cache table, and(g) transmitting the packet to a first interface corresponding to theNth cache address if the destination address is identical to the Nthcache address.

[0017] Finally, the method includes the step of (h) resetting the recentaddress and recent interface stored in the instant cache table to theNth cache address and the first interface, respectively.

[0018] In another aspect of the present invention, a method of routing apacket in a routing device having a main processor that includes a maincache table and an instant cache table includes the steps of (a)receiving a packet that includes its destination IP address, (b)checking whether the destination IP address belongs to the routingdevice, (c) checking whether the destination IP address is identical tothe recent IP address if the destination IP address does not belong tothe routing device, and (d) transmitting the packet to the recent IPinterface if the destination IP address is identical to the recent IPaddress.

[0019] The method further includes the steps of (e) calculating aHashing Key value (N) of the destination IP address if it is determinedfrom the step (c) that the destination IP address is not identical tothe recent IP address, (f) checking whether the destination IP addressis identical to an Nth cache IP address stored in the main cache table,and (g) transmitting the packet to a first IP interface corresponding tothe Nth cache IP address if the destination IP address is identical tothe Nth cache IP address.

[0020] Finally, the method further includes the step of (h) resettingthe recent IP address and recent IP interface stored in the instantcache table to the Nth cache IP address and the first IP interface,respectively.

[0021] It is to be understood that both the foregoing generaldescription and the following detailed description of the presentinvention are exemplary and explanatory and are intended to providefurther explanation of the invention as claimed.

BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The accompanying drawings, which are included to provide afurther understanding of the invention and are incorporated in andconstitute a part of this application, illustrate embodiment(s) of theinvention and together with the description serve to explain theprinciple of the invention. In the drawings;

[0023]FIG. 1 illustrates a network system including a typical routingdevice;

[0024]FIG. 2 illustrates a routing path that includes the main processorand the protocol IP layer of the routing device shown in FIG. 1;

[0025]FIG. 3 illustrates a network system including a routing device ofthe present invention;

[0026]FIG. 4 illustrates a routing path that includes the main processoronly in accordance with the present invention; and

[0027]FIG. 5 illustrates a method of routing a packet in a routingdevice according to the present invention.

DETAILED DESCRIPTION OF THE INVENTION

[0028] Reference will now be made in detail to the preferred embodimentsof the present invention, examples of which are illustrated in theaccompanying drawings. Wherever possible, the same reference numberswill be used throughout the drawings to refer to the same or like parts.

[0029]FIG. 3 illustrates a network system including a routing device 20according to the present invention. As it can be seen from the figure,the device includes a main processor 11, a protocol layer 12, a topapplication module 13, and a routing table 14.

[0030] The protocol layer 12 may include any one of the IP (InternetProtocol) layer 12A, IPX (Internetwork Packet exchange) layer 12B,Bridge layer 12C, and many others.

[0031] The main processor 11 included in the routing device 20 of thepresent invention includes a main cache table 11A and an instant cachetable 11B. The main cache table 11A additionally stores some of the coreinformation stored in the routing table 14.

[0032] For example, in a case where the routing table 14 stores variousinformation such as the destination Internet Protocol (IP) address,subset mask, gateway, metric, protocol, and interface, the main cachetable 11A additionally stores the core information including the cacheIP addresses and interfaces. Of course, the cache IP addresses stored inthe main cache table 11A are equivalent to the destination addressesstored in the routing table 14 (e.g., IP routing table 14A).

[0033] In addition, the instant cache table 11B stores the recentaddress and its corresponding interface associated with the most recentpacket transmission made by the routing device 20.

[0034] When the routing device 20 receives a packet from another node orrouting device, the main processor 11 is able to complete its packettransmission process using both tables (11A and 11B) even withouttransmitting the packet to the protocol layer 12 (e.g., IP protocollayer 12A).

[0035] In the existing routing device shown in FIG. 1, all the coreinformation is stored in the routing table 4. Therefore, each packetmust be transmitted through a routing path that includes both of themain processor 1 and the IP layer 2A.

[0036] On the other hand, in the routing device of the presentinvention, the core information related to the routing pathdetermination of a packet is stored not only in the routing table 14coupled to the protocol layer 12 but also in the main cache table 11Aand instant cache table 11B included in the main processor 11.

[0037] Therefore, a routing path including the main processor 11 only oranother routing path including both of the main processor 11 and theprotocol layer 12 can be selected for transmitting a packet. Theselection depends on the individual characteristic of the packet.

[0038] For example, as shown in FIG. 4, a routing path including themain processor 11 only can be used for transmitting a packet.Consequently, the required time for processing the packet will bereduced.

[0039] Reference will now be made in detail to a method of routing apacket in a routing device in accordance with the present invention,examples of which are illustrated in FIG. 5.

[0040] First of all, the main processor 11 of the routing device 20periodically checks whether a packet is received for each port 6 (S1).If no packet is received, it waits until a predetermined period islapsed (S2), and repeats the step S1 again for each port.

[0041] If it is determined from the step S1 that a packet is receivedthrough a port, the main processor 11 checks whether the destinationaddress (e.g., destination IP address) of the packet belongs to therouting device (S3). That is, the main processor 11 checks whether ifthe packet should be transmitted to another node or routing device. Forexample, the main processor 11 obtains the destination address (e.g. IPaddress) of the packet by searching the data region following thefourteenth byte of the IP header.

[0042] If the destination address (e.g. IP address) of the packetreceived belongs to the routing device 20, in which the main processor11 is included, the main processor 11 determines that the packet shouldbe processed in the protocol layer 12 (e.g., IP layer 12A). Therefore,it sends the packet to the protocol layer 12 (e.g., IP layer) (S20).

[0043] When the protocol layer 12 receives the packet from the mainprocessor 11, the IP layer 12 initially determines whether the packet issubject to be processed (routing) in the protocol layer (e.g., IP layer)12 (S21).

[0044] If it is not, the protocol layer 12 sends the packet to the topapplication module (TAM) 13 (S22). Otherwise, the protocol layer 12finds the interface corresponding to the destination address of thepacket by searching the routing table 14 (e.g., IP routing table 14A)(S23), and it transmits the packet to the interface found (S24).

[0045] Referring back to the step S3, if the destination address of thepacket corresponds to another routing device, the main processor 11checks whether the destination address of the packet is Unicast (S4).

[0046] If it is not (e.g., multicast, broadcast, and etc.), the mainprocessor 11 sends the packet to the protocol layer 12 (S20). Then theprotocol layer 12 repeats the steps S21 to S24.

[0047] Otherwise, the main processor 11 searches the core informationstored in the instant cache table 11B (S5) and checks whether thedestination address of the packet is identical to the recent addressstored in the instant cache table 11B (S6). As described earlier, therecent address represents the address associated with the most recentpacket transmission process made by the routing device.

[0048] If the destination address of the packet is identical to therecent address stored in the instant cache table 11B, the main processor11 finds the interface corresponding to the recent address and sends thepacket to the interface found (S7).

[0049] On the other hand, if the destination address of the packet isnot identical to the recent address stored in the instant cache table11B, the main processor 11 obtains a Hashing key corresponding to thedestination address using a Hashing function (S8).

[0050] For example, the Hashing key can be obtained by

K=(N1+N2+N3+N4)/T,  [Equation 1]

[0051] where K and T represent the Hashing key and the size of the main

[0052] cache table 11A, and N1, N2, N3, and N4 represent the first,second, third, and fourth bytes of the destination address of thepacket.

[0053] Thereafter, main processor 11 finds the cache addresscorresponding to the calculated Hashing key by searching the main cachetable 11A (S9). For example, if the Hashing key is 4, the cache addressis found in the fourth entry of the main cache table 11A. And if theHashing key is 15, the cache address is found in the fifteenth entry ofthe main cache table 11A.

[0054] Next, the main processor 11 checks whether the destinationaddress of the packet is identical to the cache address found in thestep S9 (S10).

[0055] For instance, if the Hashing key turns out to be 4, then the mainprocessor 11 checks whether the cache address that belongs to the fourthentry of the main cache table 11A is identical to the destinationaddress of the packet.

[0056] If the destination address of the packet is not identical to thecache IP address found in the step S9, the main processor 11 concludesthat the destination address does not exist in the main cache table 11A.Therefore, it sends the packet to the protocol layer 12A (S30).

[0057] When the protocol layer 12 receives the packet, the protocollayer 12 initially determines whether the packet is subject to beprocessed in the protocol layer 12 (S31).

[0058] If it is not, the protocol layer 12 sends the packet to the topapplication module (TAM) 13 (S32). Otherwise, the protocol layer 12finds the interface corresponding to the destination address of thepacket by searching the routing table 14 (e.g., IP routing table 14A)(S33), and it sends the packet to the interface found (S34).

[0059] Next, the main processor 11 stores the address and interfaceassociated with the packet transmission process made in the step S34 inthe main cache table 11A (S35). And it also stores the same informationin the instant cache table 11B (S36). Accordingly, the instant cachetable 11B includes the recent address and interface associated with themost recent packet transmission information.

[0060] Referring back to the step S10, if it is determined from the stepS10 that the destination address of the packet is identical to the cacheaddress found in the step S9, the main processor 11 sends the packet tothe interface corresponding to the cache address (S1).

[0061] Similarly, the main processor 11 stores the interface and thecache address associated with the packet transmission process made inthe step S11 in the instant cache table 11B (S12)

[0062] In conclusion, the core information related to the routing pathdetermination is stored not only in the routing table 14 of the protocollayer 12 but also in the main and instant cache tables (11A and 11B)included in the main processor 11. Since the selection of a routing pathfor a given packet depends on the individual characteristic of thepacket, the data processing time of the packet is reduced. Consequently,the routing performance of the routing device is enhanced.

[0063] It will be apparent to those skilled in the art than variousmodifications and variations can be made in the present invention. Thus,it is intended that the present invention covers the modifications andvariations of this invention provided they come within the scope of theappended claims and their equivalents.

What is claimed is:
 1. A method of routing a packet in a routing devicehaving a main processor that includes a main cache table and an instantcache table, said instant cache table storing a recent address and arecent interface associated with the most recent packet transmissionprocess made by said routing device, the method comprising the steps of:(a) receiving a packet that includes its destination address; (b)checking whether said destination address belongs to said routingdevice; (c) checking whether said destination address is identical tosaid recent address if said destination address does not belong to saidrouting device; and (d) transmitting said packet to said recentinterface if said destination address is identical to said recentaddress.
 2. The method of claim 1, further comprising the steps of: (e)calculating a Hashing Key value (N) of said destination address if it isdetermined from the step (c) that said destination address is notidentical to said recent address; (f) checking whether said destinationaddress is identical to an Nth cache address stored in said main cachetable; and (g) transmitting said packet to a first interfacecorresponding to said Nth cache address if said destination address isidentical to said Nth cache address.
 3. The method of claim 2, furthercomprising the step of (h) resetting said recent address and recentinterface stored in said instant cache table to said Nth cache addressand said first interface, respectively.
 4. The method of claim 1,further comprising the step of sending said packet to a protocol layerincluded in said routing device if it is determined from the step (b)that said destination address belongs to said routing device, saidprotocol layer being coupled to a routing table.
 5. The method of claim4, further comprising the step of sending said packet to a topapplication module included in said routing device.
 6. The method ofclaim 4, further comprising the step of transmitting said packet to afirst interface corresponding to said destination address.
 7. The methodof claim 6, wherein said first interface corresponding to saiddestination address is found by searching said routing table.
 8. Themethod of claim 2, further comprising the step of sending said packet toa protocol layer included in said routing device if it is determinedfrom the step (f) that said destination address is not identical to saidNth cache address, said protocol layer being coupled to a routing table.9. The method of claim 8, further comprising the step of sending saidpacket to a top application module included in said routing device. 10.The method of claim 8, further comprising the step of transmitting saidpacket to a second interface corresponding to said destination address.11. The method of claim 10, wherein said second interface correspondingto said destination address is found by searching said routing table.12. The method of claim 10, further comprising the steps of: storingsaid destination address and said second interface in said main cachetable; and resetting said recent address and recent interface stored insaid instant cache table to said destination address and said secondinterface.
 13. The method of claim 2, wherein said Hashing Key value isdetermined by K=(N1+N2+N3+N4)/T, where K represents said Hashing Keyvalue, T represents the size of said main cache table, and N1 to N4represent the first, second, third, and fourth byte data of saiddestination address, respectively.
 14. A method of routing a packet in arouting device having a main processor that includes a main cache tableand an instant cache table, said instant cache table storing a recent IPaddress and a recent IP interface associated with the most recent packettransmission process made by said routing device, the method comprisingthe steps of: (a) receiving a packet that includes its destination IPaddress; (b) checking whether said destination IP address belongs tosaid routing device; (c) checking whether said destination IP address isidentical to said recent IP address if said destination IP address doesnot belong to said routing device; and (d) transmitting said packet tosaid recent IP interface if said destination IP address is identical tosaid recent IP address.
 15. The method of claim 14, further comprisingthe steps of: (e) calculating a Hashing Key value (N) of saiddestination IP address if it is determined from the step (c) that saiddestination IP address is not identical to said recent IP address; (f)checking whether said destination IP address is identical to an Nthcache IP address stored in said main cache table; and (g) transmittingsaid packet to a first IP interface corresponding to said Nth cache IPaddress if said destination IP address is identical to said Nth cache IPaddress.
 16. The method of claim 15, further comprising the step of (h)resetting said recent IP address and recent IP interface stored in saidinstant cache table to said Nth cache IP address and said first IPinterface, respectively.
 17. The method of claim 14, further comprisingthe step of sending said packet to an IP layer included in said routingdevice if it is determined from the step (b) that said destination IPaddress belongs to said routing device, said IP layer being coupled toan IP routing table.
 18. The method of claim 17, further comprising thestep of transmitting said packet to first IP interface corresponding tosaid destination IP address, said first IP interface being found bysearching said IP routing table.
 19. The method of claim 15, furthercomprising the step of sending said packet to an IP layer included insaid routing device if it is determined from the step (f) that saiddestination IP address is not identical to said Nth cache IP address,said IP layer being coupled to an IP routing table.
 20. The method ofclaim 19, further comprising the step of transmitting said packet to asecond IP interface corresponding to said destination IP address, saidsecond IP interface being found by searching said IP routing table. 21.The method of claim 20, further comprising the steps of: storing saiddestination IP address and said second IP interface in said main cachetable; and resetting said recent IP address and recent IP interfacestored in said instant cache table to said destination IP address andsaid second IP interface.